package impl;

import interf.countMoney;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * 中级会员，10%的促销折扣。
 * @author cui
 * @description: TODO
 * @date 2023-11-04 13:40:23
 * @version: 1.0
 */
public class IntermediateMember implements countMoney {
    @Override
    public BigDecimal countAndMoney(BigDecimal price, int count) {
        BigDecimal multiply = price.multiply(new BigDecimal(count));
        BigDecimal multiply1 = multiply.multiply(new BigDecimal(0.1));
        BigDecimal subtract = multiply.subtract(multiply1);
        return subtract.setScale(2, RoundingMode.HALF_UP);
    }
}
